/* 重置默认样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  overflow: hidden;
  font-family: Arial, sans-serif;
  background-color: #000;
}

/* 加载界面 */
#loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  transition: opacity 0.5s;
}

#loading h1 {
  color: #fff;
  font-size: 2em;
  margin-bottom: 20px;
}

#progress-container {
  width: 80%;
  max-width: 400px;
  height: 20px;
  background-color: #333;
  border-radius: 10px;
  overflow: hidden;
}

#progress-bar {
  width: 0%;
  height: 100%;
  background-color: #4CAF50;
  transition: width 0.3s ease-in-out;
}

#loading-text {
  color: #fff;
  margin-top: 10px;
  font-size: 14px;
}

#start-button {
  display: none;
  margin-top: 20px;
  padding: 10px 20px;
  font-size: 18px;
  color: #fff;
  background-color: #4CAF50;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}

#start-button:hover {
  background-color: #45a049;
}

/* 游戏界面 */
#game-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* HUD */
#hud {
  position: fixed;
  top: 20px;
  left: 20px;
  color: #fff;
  font-size: 18px;
  text-shadow: 2px 2px 2px rgba(0, 0, 0, 0.5);
}

#score {
  margin-bottom: 10px;
}

#health {
  display: flex;
  align-items: center;
}

#health-bar {
  width: 100px;
  height: 10px;
  background-color: #333;
  margin-left: 10px;
  border-radius: 5px;
  overflow: hidden;
}

#health-fill {
  width: 100%;
  height: 100%;
  background-color: #4CAF50;
  transition: width 0.3s;
}

/* 游戏结束界面 */
#game-over {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 900;
}

#game-over h2 {
  color: #fff;
  font-size: 3em;
  margin-bottom: 20px;
}

#final-score {
  color: #fff;
  font-size: 2em;
  margin-bottom: 30px;
}

#restart-button {
  padding: 15px 30px;
  font-size: 20px;
  color: #fff;
  background-color: #4CAF50;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}

#restart-button:hover {
  background-color: #45a049;
}

/* 控制说明 */
#controls-info {
  transition: opacity 0.5s;
}

#controls-info h3 {
  margin-bottom: 10px;
  color: #4CAF50;
}

#controls-info p {
  margin: 5px 0;
}

/* 性能监视器 */
#performance-stats {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 100;
}

/* 调试信息 */
#debug-info {
  position: fixed;
  bottom: 20px;
  right: 20px;
  color: #fff;
  background-color: rgba(0, 0, 0, 0.7);
  padding: 10px;
  border-radius: 5px;
  font-family: monospace;
  font-size: 12px;
  z-index: 100;
  display: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
  #loading h1 {
    font-size: 1.5em;
  }
  
  #progress-container {
    width: 90%;
  }
  
  #hud {
    font-size: 16px;
  }
  
  #game-over h2 {
    font-size: 2em;
  }
  
  #final-score {
    font-size: 1.5em;
  }
  
  #controls-info {
    font-size: 12px;
  }
}

/* Canvas样式 */
canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
} 